<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="dt" uri="http://livraria.com.br/datatable" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Exemplo JSTL</title>
	<c:import url="/header.jsp"></c:import>
</head>

<body>
	Jeferson <br/>
	<c:out value="Jeferson"></c:out>
	
	<br />
	
	<c:import url="/menu.jsp"></c:import>
	
	<br />
	
	<table>
		<c:forEach items="${listaAutor}" var="a" varStatus="status">
			
			<c:if test="${status.index % 2 == 1}">
				<c:set value="#FFF" scope="request" var="cor"></c:set>
			</c:if>
			<c:if test="${status.index % 2 == 0}">
				<c:set value="#CCC" scope="request" var="cor"></c:set>
			</c:if>
			
			<tr>
				<td style="background-color: ${cor};">
					<c:out value="${a.nome}"></c:out> <br/>
					- <b></b><c:out value="${codigo}"></c:out></b>
				</td>
			</tr>
			
		</c:forEach>
	</table>
	<p />
	
	<!-- igual ao SWHITCH CASE DEFAULT do Java -->
	<c:choose>
		<c:when test="${10 == 10}">
			AAAAA
		</c:when>	
		<c:otherwise>
			BBBB
		</c:otherwise>
	</c:choose >
	
	<br />
	
			
		Antes: ${cor}
		<c:remove var="cor"/>
		<br/>
		Depois: ${cor}
		
	<br />
	
	<br />
	<br />
	<br />
	<dt:lista attrDados="${listaAtributos}" listaNomeColunas="${listaColunas}" 
	classe="br.com.livraria.vo.Livro" lista="listaLivros"></dt:lista>
</body>
</html>
